//@ sourceURL=MeetManageView.js
Ext.ns("MeetManageView");

MeetManageView = Ext.extend(Ext.Panel,{
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        MeetManageView.superclass.constructor.call(this, {
            id : "MeetManageView",
            title : "会议管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
    var yearGridComponents=new createyeargridview({
        topbar : {
            inputFormName : 'MeetManageForm',
            topbarAdd:{
                hidden:false
            },
            topbarDel:{
                hidden:false
            }
        },
        search : {
            items : [ {
                style : "margin:5px 5px 5px 5px;",
                text : "会议主题"
            }, {
                columnWidth : 0.2,
                xtype : "textfield",
                name : "Q_meetTheme_S_LK",
                maxLength : 256
            } ]
        },
        grid : {
            title : "会议管理列表",
            rowActions:true,
            listUrl : __ctxPath + "/safemeeting/listMeetManage.do",
            removeUrl : __ctxPath + "/safemeeting/deleteMeetManage.do",
            fields : [ "id", "years", "institution","meetTheme", "meetType", "meetDate", "department", "meetPlace"],
            columns : [ {
                header : "id",
                dataIndex : "id",
                hidden : true
            },{
                header : "年份",
                dataIndex : "years",
                width : 50,
                hidden : true,
                sortable : true
            },{
                header : "所属机构",
                dataIndex : "institution",
                width:80
            },{
                header : "会议纪要",
                dataIndex : "id",
                sortable : true,
                width:70,
                renderer : function(j, i, g, m, h) {
                    var id = g.data.id;
                    var buttons = "";
                    if (id != -1) {
                        if (isGranted("_MeetManageEdit")) {
                            buttons += '<a href="#" onclick="MeetManageView.edit(' + id + ')">会议纪要</a>';
                            
                        }
                    }
                    return buttons;
                }
            },{
                header : "主题",
                dataIndex : "meetTheme",
                width:80
            },{
                header : "会议类型",
                dataIndex : "meetType",
                width:70,
                renderer : function(j,i,g,m,h){
                    if(j==1){
                        return "政府级";
                    }else if(j==2){
                        return "公司级";
                    }else if(j==3){
                        return "部门级";
                    }
                }
            },{
                header : "会议时间",
                dataIndex : "meetDate",
                width:70
            },{
                header : "参会部门",
                dataIndex : "department",
                width:80
            },{
                header : "会议地点",
                dataIndex : "meetPlace",
                width:100
            } ]
        },
        tree : {
            treeUrl : __ctxPath + "/safemeeting/treeLoadMeetManage.do"
        }
        
    });
    return yearGridComponents;
}
});
MeetManageView.edit = function(id) {
    new MeetingMinutesForm({
        id : id,
        operation: Constant.Operation.EDIT
    }).show();
};